#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh

DEVICE_NAME=$(fw_printenv -n DEVICE_NAME)
DEVICE_SERIAL_NUMBER=$(fw_printenv -n DEVICE_SERIAL_NUMBER)
#MANUFACTURING_DATE=$(fw_printenv -n MANUFACTURING_DATE)
#VENDOR_NAME=$(fw_printenv -n VENDOR_NAME)

uci batch <<EOF
set system.@system[0].DEVICE_NAME=${DEVICE_NAME}
set system.@system[0].DEVICE_SERIAL_NUMBER=${DEVICE_SERIAL_NUMBER}
set system.@system[0].hostname=${DEVICE_SERIAL_NUMBER}
set system.@system[0].log_size='1280'
set system.@system[0].log_buffer_size='128'
set system.@system[0].log_file='/var/log/messages'

set system.timeset=systemtime

delete system.ntp.server
add_list system.ntp.server='ntp.ntsc.ac.cn'
add_list system.ntp.server='ntp1.aliyun.com'
add_list system.ntp.server='ntp2.aliyun.com'
add_list system.ntp.server='ntp3.aliyun.com' 
commit system

EOF
